<!--
    -  Copyright (c) 2018-2025, haohanwork.com All rights reserved.
  -->
<template>
  <div class="execution">
    <basic-container>
      <h2 class="io-goods-detail">基础信息</h2>
      <template>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6">
            <div class="grid-content bg-purple">盘点单号:{{basicInformation.purchaseOrderId}}</div>
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple-light">仓库:{{basicInformation.checkStatus}}</div>
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple"></div>
            单据类型:{{basicInformation.purchaseType}}
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple"></div>
            状态:{{basicInformation.purchaseType}}
          </el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6">
            <div class="grid-content bg-purple-light"></div>
            创建日期:{{basicInformation.supplierName}}
          </el-col>
          <!-- <el-col :span="6">
            <div class="grid-content bg-purple">关联单号:{{basicInformation.deliveryTime}}</div>
          </el-col>-->
          <el-col :span="6">
            <div class="grid-content bg-purple-light">制单人:{{basicInformation.purchaseEmployee}}</div>
          </el-col>
        </el-row>
        <!-- <el-row class="io-goods-detail basic-information">
          <el-col :span="6">
            <div class="grid-content bg-purple"></div>
            仓库:{{basicInformation.makeBill}}
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple"></div>
            备注:{{basicInformation.makeBill}}
          </el-col>
        </el-row>-->
      </template>
    </basic-container>
    <basic-container>
      <h2 class="io-goods-detail">单据详情</h2>
      <template>
        <el-table :data="tableData" border show-summary style="width: 100%">
          <el-table-column prop="id" label="序号" type="index" width="180px"></el-table-column>
          <el-table-column prop="goods" label="商品"></el-table-column>
          <el-table-column prop="unit" sortable label="单位"></el-table-column>
          <el-table-column prop="sum" label="原有数量"></el-table-column>
          <el-table-column prop="unitPrice" sortable label="实际数量"></el-table-column>
          <!-- <el-table-column prop="money" sortable label="金额"></el-table-column> -->
        </el-table>
      </template>
    </basic-container>
    <basic-container>
      <h2 class="io-goods-detail">单据修改记录</h2>
      <template>
        <el-table
          :data="operationalHistory"
          style="width: 100%"
          :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        >
          <el-table-column label="序号" prop="id" align="center" type="index"></el-table-column>
          <el-table-column label="修改日期" prop="operatingTime" align="center"></el-table-column>
          <el-table-column label="修改人" prop="operator" align="center"></el-table-column>
          <el-table-column label="修改参数" prop="type" align="center"></el-table-column>
          <el-table-column label="变更前参数" prop="log" align="center"></el-table-column>
          <el-table-column label="变更后参数" prop="log" align="center"></el-table-column>
        </el-table>
      </template>
      <template>
        <div class="return-btn">
          <el-button type="primary" plain @click="backup">返回</el-button>
        </div>
      </template>
    </basic-container>
  </div>
</template>
<!-- 采购退货 -->
<script>
import { mapGetters } from "vuex";
export default {
  name: "addpurchaseback",
  data() {
    return {
      tableData: [
        {
          goodsImg: "http://i2.tiimg.com/684003/5bbcef207e546891.png",
          goods: "测试商品",
          unit: "斤",
          num: 12,
          price: 2.2,
          money: 28.4,
          desc: ""
        },
        {
          goodsImg: "http://i2.tiimg.com/684003/5bbcef207e546891.png",
          goods: "测试商品",
          unit: "斤",
          num: 12,
          price: 2.2,
          money: 28.4,
          desc: ""
        },
        {
          goodsImg: "http://i2.tiimg.com/684003/5bbcef207e546891.png",
          goods: "测试商品",
          unit: "斤",
          num: 12,
          price: 2.2,
          money: 28.4,
          desc: ""
        },
        {
          goodsImg: "http://i2.tiimg.com/684003/5bbcef207e546891.png",
          goods: "测试商品",
          unit: "斤",
          num: 12,
          price: 2.2,
          money: 28.4,
          desc: ""
        }
      ],
      otherMoney: 100,
      calcMoney: 1000,
      basicInformation: {
        purchaseOrderId: "POI10000",
        checkStatus: "待审核",
        purchaseType: "平台直购",
        supplierName: "浩瀚小店",
        deliveryTime: "2019-03-09",
        purchaseEmployee: "张**",
        makeBill: "运营"
      },
      operationalHistory: [
        {
          operatingTime: "2019-02-01 12:00",
          operator: "张**",
          type: "新增采购单",
          log: "已新增采购单"
        },
        {
          operatingTime: "2019-02-01 12:00",
          operator: "张**",
          type: "新增采购单",
          log: "已新增采购单"
        },
        {
          operatingTime: "2019-02-01 12:00",
          operator: "张**",
          type: "新增采购单",
          log: "已新增采购单"
        }
      ]
    };
  },
  computed: {
    ...mapGetters(["permissions"])
  },
  methods: {
    backup: function() {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="scss" scoped>
.io-goods-detail {
  margin-left: 10px;
}
.settle-accounts {
  text-align: right;
}
.basic-information {
  margin-top: 20px;
  font-weight: inherit;
}
.return-btn {
  height: 100px;
  width: 100%;
  text-align: center;
  line-height: 100px;
}
</style>
